<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>分发请求</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="yaf-dispatcher.disableview.html">« Yaf_Dispatcher::disableView</a></li>
      <li style="float: right;"><a href="yaf-dispatcher.enableview.html">Yaf_Dispatcher::enableView »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="class.yaf-dispatcher.html">Yaf_Dispatcher</a></li>
    <li>分发请求</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="yaf-dispatcher.dispatch" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">Yaf_Dispatcher::dispatch</h1>
  <p class="verinfo">(Yaf &gt;=1.0.0)</p><p class="refpurpose"><span class="refname">Yaf_Dispatcher::dispatch</span> &mdash; <span class="dc-title">分发请求</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-yaf-dispatcher.dispatch-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><strong>Yaf_Dispatcher::dispatch</strong></span>(<span class="methodparam"><span class="type"><a href="class.yaf-request-abstract.html" class="type Yaf_Request_Abstract">Yaf_Request_Abstract</a></span> <code class="parameter">$request</code></span>): <span class="type"><a href="class.yaf-response-abstract.html" class="type Yaf_Response_Abstract">Yaf_Response_Abstract</a></span></div>

  <p class="para rdfs-comment">
   <span class="classname"><a href="class.yaf-dispatcher.html" class="classname">Yaf_Dispatcher</a></span> 的这个方法做的工作很繁重.它需要一个request对象。
  </p>
  <p class="para">
    分发过程有三个不同的事件：
    <ul class="simplelist">
      <li class="member">路由</li>
      <li class="member">分发</li>
      <li class="member">响应</li>
    </ul>

   The dispatch process has three distinct events:
  <ul class="simplelist">
   <li class="member">Routing</li>
   <li class="member">Dispatching</li>
   <li class="member">Response</li>
  </ul>
   路由只发生一次，当dispatch()被调用的时候，需要使用请求对象中的值。分发发生在一个循环中；一个请求可能会分发出多个action，
   或者controller或者一个plugin可能重置请求对象来强制分发其他的action（参见 <span class="classname"><a href="class.yaf-plugin-abstract.html" class="classname">Yaf_Plugin_Abstract</a></span>）。
   当所有都执行完毕，<span class="classname"><a href="class.yaf-dispatcher.html" class="classname">Yaf_Dispatcher</a></span> 会返回一个响应。
  </p>



 </div>


 <div class="refsect1 parameters" id="refsect1-yaf-dispatcher.dispatch-parameters">
  <h3 class="title">参数</h3>
  <dl>
   
    <dt>
<code class="parameter">request</code></dt>

    <dd>

     <p class="para">
      
     </p>
    </dd>

   
  </dl>

 </div>


 <div class="refsect1 returnvalues" id="refsect1-yaf-dispatcher.dispatch-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
  </p>
 </div>



</div></div></div></body></html>